/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pfc.modeloer;

import org.apache.ddlutils.model.Reference;

/**
 *
 * @author xandru
 */
public class ManyToManyRelationShip extends ERRelationShip{

    String tableName;

    public ManyToManyRelationShip()
    {
        setType(ERRelationShip.RelationType.ManyToMany.toString());
    }

    void setTableName(String name) {
        tableName=name;
    }

    @Override
    public String toVerboseString()
    {
        StringBuilder sf=new StringBuilder();

        sf.append(this.getName());
        sf.append("\n----------------------\n");
        for (EREntity e:this.getMembers())
        {
            sf.append("\t[");
            sf.append(e.getName());
            sf.append("]\n");

        }

        sf.append("=============\n");
        for (ERReference r:this.getReferences())
        {
                sf.append(r.sourceEntity);
                sf.append(".");
                sf.append(r.sourceAttrib);
                sf.append("<->");
                sf.append(r.targetEntity);
                sf.append(".");
                sf.append(r.targetAttrib);
                
            sf.append("\n");
        }
        
        return sf.toString();
    }



}
